package com.crm.system.controller.couponManager;

import com.crm.common.model.DataResponse;
import com.crm.common.model.DhResponse;
import com.crm.common.model.Enum.ResponseCodeEnum;
import com.crm.model.entity.couponManager.CustomerContractCoupon;
import com.crm.system.service.couponManager.ContractCouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * @author luojie
 * @date 2021/5/21 16:09
 */
@RequestMapping("/contractCoupon")
@RestController
public class ContractCouponController {

    @Autowired
    private ContractCouponService contractCouponService;

    /***
     * @Description:根据合同id查询合同优惠券信息
     * @Param:contractId 合同id
     * @Author: luojie
     * @Date: 2021/5/21 16:11
     */
    @GetMapping("/selectContractCouponByContractId")
    public DataResponse selectContractCouponByContractId(@RequestParam String contractId){
        List<CustomerContractCoupon> customerContractCoupons = contractCouponService.selectContractCouponByContractId(contractId);
        return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),customerContractCoupons);
    }

}
